package com.example.shiwuyouproject.ui.fragment.my.activity.adapter

import android.annotation.SuppressLint
import android.app.Activity
import android.graphics.drawable.Drawable
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.example.shiwuyouproject.R
import com.example.shiwuyouproject.ui.fragment.my.activity.bean.LefitTimeBean


class LefitTimeAdapter:BaseQuickAdapter<LefitTimeBean, BaseViewHolder>(R.layout.item_lefittime) {
    @SuppressLint("NewApi")
    override fun convert(helper: BaseViewHolder?, item: LefitTimeBean?) {
            helper?.setText(R.id.tvTime, item?.stTime)
        val tvTime: TextView? =helper?.getView(R.id.tvTime)
       if((data.size-1)==helper?.adapterPosition){
           val btnDrawable: Drawable = mContext.getDrawable(R.drawable.main_boder_w1_f2f4f7_r1_but)!!
           tvTime?.background = btnDrawable
       }else{
           val btnDrawable: Drawable = mContext.getDrawable(R.drawable.main_boder_w1_f2f4f7_r11)!!
           tvTime?.background = btnDrawable
       }
    }
}